﻿package net.wangit.view.element.component;

import net.wangit.LabelUtil;
import net.wangit.Page;
import net.wangit.Row;
import net.wangit.context.ActionContext;
import net.wangit.support.ElementWriter;
import net.wangit.util.Checker;
import net.wangit.view.element.ElementComponent;

public final class CheckBoxFieldElement extends ElementComponent {

	protected static final String LABEL_PREFIX = "element.52.";
	private static final ElementWriter writer = new CheckBoxFieldElementWriter();

	public CheckBoxFieldElement() {
	}

	public CheckBoxFieldElement(String id, String name) {
		setId(id);
		setName(name);
	}

	public String getText(ActionContext ac, String value) {
		if (Checker.isEmpty(value))
			return "";
		else
			return LabelUtil.get(ac, "components", (new StringBuilder(
					"element.52.")).append(value).toString());
	}

	protected void configure(Row row1) {
	}

	protected ElementWriter getWriter() {
		return writer;
	}

	protected void cloneAfter(ActionContext actioncontext, Page page1) {
	}

}
